<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ page import="com.google.appengine.api.users.User"%>
<%@ page import="com.google.appengine.api.users.UserService"%>
<%@ page import="com.google.appengine.api.users.UserServiceFactory"%>

<html>
<head>
<title>Non Administrator Login</title>
<link href="css/bootstrap.css" rel="stylesheet">
</head>
<body>
	<%
		UserService userService = UserServiceFactory.getUserService();
		User user = userService.getCurrentUser();
		if (user == null) {
			response.sendRedirect(userService.createLoginURL(request
					.getRequestURI()));
		}

		if (userService.isUserAdmin()) {
			response.sendRedirect("admin.jsp");
		}
	%>

	<legend>Absence of Administrative Privileges</legend>
	<br />

	<center>
		<h>Dear <%=user.getNickname()%>, Our system detects that your
		google account lacks adminstrative previliges to access this
		application</h>
	</center>
	<br />
	<center>
		<h>Please click <a
			href="<%=userService.createLogoutURL(request.getRequestURI())%>">here</a>
		to sign out</h>
	</center>
</body>
</html>